package com.example.gateway.config;

import cn.hutool.core.collection.ListUtil;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

/**
 * @author 王令
 * @since 2022/9/23 13:44
 */
@Getter
@Setter
@ConfigurationProperties(prefix = "com.example.gateway")
public class GatewayProperties {

    private DemoEnv demoEnv = new DemoEnv();

    private MultiTenant multiTenant = new MultiTenant();

    @Getter
    @Setter
    public static class DemoEnv {
        private Boolean enabled = false;
        private List<String> permitUrls = ListUtil.of("/oauth/**");
    }

    @Getter
    @Setter
    public static class MultiTenant {
        private List<String> permitUrls = ListUtil.of("/oauth/**", "/tenant/list");
    }
}
